package com.dc.datacollect.controller;

import com.dc.datacollect.conduit.R;
import com.dc.datacollect.helpers.SessionProvide;
import com.dc.datacollect.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/current")
    public R currentUser() {
        return R.ok("查询当前用户信息成功").data(userService.getById(SessionProvide.getLoginObject().getId()));
    }
}
